
import service from '../../request'
export const attrInfoList = (pageNo,pageSize,category1Id,category2Id,category3Id) => {

    if(category2Id==='' && category3Id===''){
        return service({
            url: `api/admin/product/baseAttr/attrInfoList/${pageNo}/${pageSize}/${category1Id}`,
            method: 'get'
        })
    }else if (category3Id===''){
        return service({
            url: `api/admin/product/baseAttr/attrInfoList/${pageNo}/${pageSize}/${category1Id}/${category2Id}`,
            method: 'get'
        })
    }
    return service({
        url: `api/admin/product/baseAttr/attrInfoList/${pageNo}/${pageSize}/${category1Id}/${category2Id}/${category3Id}`,
        method: 'get'
    })
};

export const saveAttrInfo = (attrInfo) => {

    return service({
        url: `api/admin/product/baseAttr/save`,
        method: 'post',
        data:attrInfo
    })
};

export const deleteAttrInfo = (attrId) => {

    return service({
        url: `api/admin/product/baseAttr/remove/${attrId}`,
        method: 'delete'
    })
};